package p270jp.pxv.android.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import androidx.databinding.DataBindingUtil;
import p014ae.View$OnClickListenerC0156s7;
import p045be.View$OnClickListenerC1058b0;
import p045be.View$OnLongClickListenerC1066e1;
import p090d0.C2518n;
import p144f1.C3017s;
import p183gh.ABTestService;
import p184gi.AnalyticsParameter;
import p270jp.pxv.android.R;
import p270jp.pxv.android.legacy.model.PixivNovel;
import p270jp.pxv.android.viewholder.NovelItemViewHolder;
import p314lg.ViewNovelCardItemBinding;
import p374nm.BaseMuteLayout;
import p677zi.PixivImageLoader;

/* renamed from: jp.pxv.android.view.NovelCardItemView */
/* loaded from: classes2.dex */
public class NovelCardItemView extends BaseMuteLayout {

    /* renamed from: f */
    public static final /* synthetic */ int f19582f;

    /* renamed from: b */
    public ViewNovelCardItemBinding f19583b;

    /* renamed from: d */
    public AnalyticsParameter f19585d = null;

    /* renamed from: c */
    public PixivImageLoader f19584c = (PixivImageLoader) C2518n.m7641d(PixivImageLoader.class);

    /* renamed from: e */
    public ABTestService f19586e = (ABTestService) C2518n.m7641d(ABTestService.class);

    public NovelCardItemView(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
    }

    @Override // p374nm.BaseMuteLayout
    /* renamed from: a */
    public View mo3337a() {
        ViewNovelCardItemBinding gaVar = (ViewNovelCardItemBinding) DataBindingUtil.m11370c(LayoutInflater.from(getContext()), R.layout.view_novel_card_item, this, false);
        this.f19583b = gaVar;
        return gaVar.f2666e;
    }

    public void setAnalyticsParameter(AnalyticsParameter cVar) {
        this.f19585d = cVar;
        this.f19583b.f21625r.setAnalyticsParameter(cVar);
    }

    public void setNovelItem(NovelItemViewHolder.NovelItem novelItem) {
        PixivNovel target = novelItem.getTarget();
        if (C3017s.m6470f(target, false)) {
            setMuteCoverVisibility(0);
            return;
        }
        setMuteCoverVisibility(8);
        this.f19583b.f21626s.setNovel(target);
        this.f19584c.m60f(getContext(), target.user.profileImageUrls.getMedium(), this.f19583b.f21628u);
        this.f19583b.f21624q.setText(target.title);
        this.f19583b.f21629v.setText(target.user.name);
        this.f19583b.f21628u.setOnClickListener(new View$OnClickListenerC1058b0(this, target, 4));
        this.f19583b.f21625r.setWork(target);
        setOnClickListener(new View$OnClickListenerC0156s7(this, target, 6));
        setOnLongClickListener(new View$OnLongClickListenerC1066e1(target, 1));
    }

    public void setRankingBadgeResource(int i) {
        this.f19583b.f21627t.setImageResource(i);
        this.f19583b.f21627t.setVisibility(0);
    }
}
